// src/router/index.js
import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router'
import { constantRoute, anyRoute } from './routes'


// 2. 定义路由规则
const routes = constantRoute

// 3. 创建路由实例
const router = createRouter({
    history: createWebHistory(),
    routes,
    //滚动行为
    scrollBehavior() {
        return {
            left: 0,
            top: 0
        }
    }
})
export function resetRouter() {
    const newRouter = createRouter()
    router.matcher = newRouter.matcher // the relevant part
}



export default router
